<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of updateuserdata
 *
 * @author slaber
 */
class Manageuser_Data_Updateuserdata Implements Manageuser_Data_Mainable,
        Manageuser_Data_Preparable, Manageuser_Data_Redirectable {
    //put your code here
    public $database;
    public $database_query;
    public $redirect;
    
    public function __construct() {
        $this->database = new Core_Driver_MysqlImproved;
    }
    
    public function main(array $variables = null) {
        $this->database->connect();
        foreach ($variables as $key => $value){
            $variables[$key] = $this->database->escape($value);
        }
        $this->prepare_query($variables);
        $this->database->prepare($this->database_query);
        $this->database->query();
        $this->database->dataOperations();
        $this->redirect_action($variables);
        
    }

    public function prepare_query(array $variables = null) {
        $this->database_query = "UPDATE 
            user_object
            SET
            access_level = "
            .$variables['access_level'].
            ",
            user_banned = "
            .$variables['user_banned'].
            ",
            WHERE
            user_id = "
            .$variables['user_id'].
            ";";
        
    }

    public function redirect_action(array $variables = null) {
        
    }
}

?>
